<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <div th:insert="commen/head :: header">
    </div>
    <link rel="stylesheet" th:href="@{/css/reset.css}">
    <link rel="stylesheet" th:href="@{/css/iconfont/iconfont.css}">
    <link rel="stylesheet" th:href="@{/css/release-homework.css}">
</head>
<body  style="background-color: rgb(242,244,247)">
    <div th:insert="commen/navigationBar :: topNavBar"></div>

    <div class="container-fluid">
        <div class="row">
            <div class="col-md-2">
                <div th:insert="commen/navigationBar :: leafStuNavBar"></div>
            </div>
            <div class="col-md-10">
                <div style="background-color: #fff; margin-top: 5px; padding: 15px; border-radius: 15px">
                    <div th:each="homework:${homeworks}"  style="background-color: #fafafa; margin-bottom: 10px; text-align: left">
                        <a th:href="@{'/studentHomeworkInfo/' + ${homework.getHomeworkId()}}" th:if="${homework.getHomeworkState() == 0}" style="color: black; text-decoration: none; padding: 5px;">
                            <div class="media" style="text-align: left; margin-left: 10px;">
                                <div class="media-left media-top">
                                    <img th:src="@{../img/homework.jpg}" class="media-object" style="width:60px">
                                </div>
                                <div class="media-body">
                                    <h4 style="font-weight: bold;" class="media-heading" >[[${homework.getHomework().getHomeworkName()}]]</h4>
                                    <p>
                                        作答时间: <span th:text="${homework.getHomework().getStartTime()}"></span> ~ <span th:text="${homework.getHomework().getEndTime()}"></span><br>
                                        <span style="font-weight: bold; color: #2aabd2" th:if="${homework.getHomework().getHomeworkStatus() == 1}">作业进行中</span>
                                        <span style="font-weight: bold; color: red" th:if="${homework.getHomework().getHomeworkStatus() == 0}">作业已结束</span>
                                        <span style="font-weight: bold;">未完成</span>
                                    </p>
                                </div>
                            </div>
                        </a>
                        <a th:href="@{'/studentHomeworkInfo/' + ${homework.getHomeworkId()}}" th:if="${homework.getHomeworkState() == 1}" style="color: black; text-align: left; text-decoration: none; padding: 5px;">
                            <div class="media" style="text-align: left; margin-left: 10px;">
                                <div class="media-left media-top">
                                    <img th:src="@{../img/homeworkEnd.jpg}" class="media-object" style="width:60px">
                                </div>
                                <div class="media-body">
                                    <h4 style="font-weight: bold;" class="media-heading" >[[${homework.getHomework().getHomeworkName()}]]</h4>
                                    <p>
                                        作答时间: <span style="font-size: 14px; color:#797979;" th:text="${homework.getHomework().getStartTime()}"></span> ~ <span style="font-size: 14px; color:#797979;" th:text="${homework.getHomework().getEndTime()}"></span><br>
                                        <span style="font-weight: bold; color: #2aabd2" th:if="${homework.getHomework().getHomeworkStatus() == 1}">作业进行中</span>
                                        <span style="font-weight: bold; color: red" th:if="${homework.getHomework().getHomeworkStatus() == 0}">作业已结束</span>
                                        <span style="font-weight: bold;">已完成 分数:</span><span th:text="${homework.getHomeworkScore()}"></span>
                                    </p>
                                </div>
                            </div>
                        </a>
                    </div>
                    <div th:if="${homeworks.isEmpty()}" style="font-size: 18px; color:#7c7c7c; margin-top: 40px; margin-bottom: 40px;">
                        暂无作业
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>